package cn.itcast.day03;

import sun.security.mscapi.CPublicKey;

import java.util.ArrayList;

public class Demo03ArrayListPrint {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();

        list.add(10);
        list.add(20);
        list.add(30);
        list.add(40);

        System.out.println(list);
        ArrayListPrint(list);

    }

    public static void ArrayListPrint(ArrayList<Integer> list1) {
        System.out.print("{");

        for (int i = 0; i < list1.size(); i++) {
            int num = list1.get(i);
            if (i == list1.size()-1) {
                System.out.print(num + "}");
            }else {
            System.out.print(num + "@");
        }
        }
    }
}
